﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PR_CommandDtls.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.PR_CommandDtls" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>รายละเอียดแนบท้ายคำสั่ง</title>
</head>
<body>
    <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" /> 
    <form id="form1" runat="server">
    <script type="text/javascript" src="../../Scripts/DatePicker.js"></script>
    <script type="text/javascript">   

          function isNumberKey(event)  // ตัวเลขอย่างเดียว
          {
             var charCode = (event.which) ? event.which : event.keyCode
             if(charCode > 31 && (charCode < 48 || charCode > 57)){
//                 alert("กรอกได้แต่ตัวเลขครับ!")
                 return false;
	          }
             return true;
          }
          function isNumberKeyDot(event)  // ตัวเลขทศนิยม
          {
             var charCode = (event.which) ? event.which : event.keyCode
             if(charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 46){
                 alert("กรุณากรอกเฉพาะตัวเลข!")
                 return false;
                 }
             return true;
          }
           function onTextChange(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
                }
        function MessageAlert(strMessageAlert) {
            window.alert(strMessageAlert);
        }

</script>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="btnSearch">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="btnSearch" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>           
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" 
        Height="100%" Width="75px" Transparency="50">
        <table style="height: 100%; width: 100%" border="0">
            <tr>
                <td width="100%" align="center" valign="middle">
                    <img alt="Loading..." 
                        src="../Images/Buttons/loading1.gif" 
                        style="border: 0px;" />
                </td>
            </tr>
        </table>
    </telerik:RadAjaxLoadingPanel>
    
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
    <telerik:RadWindow 
        id="ProjectDtls" 
        runat="server"
        showcontentduringload="false"
        VisibleStatusbar="false"
        title="การบริหารค่าตอบแทน/บัญชีแนบท้ายคำสั่ง"
        width="1050px"
        Height="600px"        
        Modal="true"
        behaviors="Close">
    </telerik:RadWindow>
</Windows>

</telerik:RadWindowManager>
    
    <div class="moduleDivSlim1000x450">
    <div class="moduleDivBottom1000">
        <table align="center" width ="980px" >
            <tr>
                <td width="100px">
                    <asp:Label ID="lblTypeYear" runat="server" BorderStyle="None"></asp:Label>
                </td>
                <td align="left" width="150px">
                    <telerik:RadComboBox ID="ddlYear" runat="server" 
                        AllowCustomText="true" 
                        CausesValidation="false" DataTextField="Name" 
                        DataValueField="Name" 
                        EmptyMessage="...เลือกปี ..." Filter="Contains" 
                        OnClientTextChange="onTextChange" Width="100px">
                    </telerik:RadComboBox>
                    <asp:RequiredFieldValidator runat="server" 
                        ID="v1" 
                        ControlToValidate="ddlYear"
                        ErrorMessage="*" >
                    </asp:RequiredFieldValidator>
                </td>
                <td align="right" width="100px">
                    การเลื่อนเงินเดือน :
                </td>
                <td width="15%">
                    <asp:RadioButtonList ID="radPromotion" runat="server"
                        RepeatDirection="Horizontal">
                        <asp:ListItem Value="1" Selected = "True">ครั้งที่ 1</asp:ListItem>
                        <asp:ListItem Value="2">ครั้งที่ 2
                    </asp:ListItem>
                    </asp:RadioButtonList>                    
                </td>
                <td >
                    <asp:Label ID="lblMsg" runat="server" ForeColor="Red" 
                        Text="ไม่มีรอบการประเมินในปีที่เลือก!!" Visible="False">
                    </asp:Label>
                </td>
                <td>
                    <asp:Button ID="cmdAutoInsert" runat="server" 
                        onclick="cmdAutoInsert_Click" 
                        Text="บันทึกข้อมูลอัตโนมัติ" Width="80px" />
                </td>
            </tr>            
        </table>
    </div>
    </div>
    <div class="moduleDivSlim1000x450">
        <div class="moduleDivBottom1000">
        <table width ="980px" align = "center" >
            <tr>
                <td class ="tableHeader">บัญชีรายละเอียด 
                    <asp:Label ID="lblCmdName" runat="server" Text="...ไม่ระบุ..." ForeColor="Blue"></asp:Label>
                    &#160;&#160;&#160;&#160;&#160; แนบท้ายคำสั่งที่ 
                    <asp:Label ID="lblRefNo" runat="server" Text="...ไม่ระบุ..." ForeColor="Blue"></asp:Label>
                    &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ลงวันที่ 
                    <asp:Label ID="lblAppDate" runat="server" Text="...ไม่ระบุ..." ForeColor="Blue"></asp:Label>
                    <asp:Label ID="lblID" runat="server" Visible="False"></asp:Label>
                </td>
            </tr>
            <tr>
                <td >
                    <asp:Panel ID="PanelDetal" 
                        runat="server" 
                        Width="980px" 
                        Height="400px" ScrollBars="Auto" >
                        <telerik:RadGrid ID="RadGrid1" runat="server" 
                            AllowAutomaticDeletes="True" 
                            AllowFilteringByColumn="True" 
                            AllowMultiRowEdit="True" 
                            AllowMultiRowSelection="True" AllowPaging="True" 
                            AllowSorting="True" 
                            AutoGenerateColumns="False" 
                            EnableAJAX="True" 
                            EnableAJAXLoadingTemplate="True" GridLines="None" 
                            OnItemCommand="RadGrid1_ItemCommand" 
                            GroupingSettings-GroupByFieldsSeparator = "&nbsp;&nbsp;&nbsp;&nbsp;"
                            GroupingSettings-GroupContinuedFormatString = ""
                            GroupingSettings-GroupContinuesFormatString = ""
                            GroupingSettings-GroupSplitFormat = ""
                            Skin="Outlook" Width="950px">
                            <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" 
                                ClientDataKeyNames="cmd_dtls_seq" 
                                CommandItemDisplay="Top" 
                                DataKeyNames="cmd_dtls_seq" 
                                InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                                NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                                <CommandItemTemplate>
                                    <table width="100%">
                                        <tr>
                                            <td>
                                            <asp:LinkButton ID="cmdAddNew" runat="server" CausesValidation="False" 
                                                CommandName="InitInsert" 
                                                Visible="<%# !RadGrid1.MasterTableView.IsItemInserted && RadGrid1.EditIndexes.Count <= 0 %>"> 
                                                <img alt="" src="../Images/Buttons/AddRecord.gif" 
                                                    style="border: 0px; vertical-align: middle;" /> เพิ่มรายชื่อบุคลากร
                                            </asp:LinkButton>&#160;&#160; 
                                            </td>
                                            <td align="right">
                                            </td>
                                        </tr>
                                    </table>
                                </CommandItemTemplate>
                    <RowIndicatorColumn>
                    <HeaderStyle Width="20px" /></RowIndicatorColumn>
                    <ExpandCollapseColumn Visible="True"></ExpandCollapseColumn>
                    <GroupByExpressions>
                            <telerik:GridGroupByExpression>
                                <GroupByFields>
                                    <telerik:GridGroupByField 
                                        FieldName="new_job_site_seq" 
                                        HeaderText="Group" />
                                </GroupByFields>
                                <SelectFields>
                                    <telerik:GridGroupByField 
                                        FieldName="new_job_site_name" 
                                        HeaderText="สังกัด" 
                                        HeaderValueSeparator = " " /> 
                                </SelectFields>
                            </telerik:GridGroupByExpression>
                        </GroupByExpressions> 
                    <Columns>
                    <telerik:GridEditCommandColumn 
                        ButtonType="ImageButton"
                        EditText="คลิกเพื่อแก้ไขข้อมูล">
                        <ItemStyle Width="15px" />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" 
                        ConfirmDialogType="RadWindow" ConfirmText="ลบข้อมูลที่เลือก?" 
                        Text="คลิกเพื่อลบข้อมูล" UniqueName="column1">
                        <HeaderStyle HorizontalAlign="Center" Width="10px" />
                        <ItemStyle HorizontalAlign="Center" Width="10px" />
                    </telerik:GridButtonColumn>                        
                    <telerik:GridTemplateColumn
                        HeaderText = "ชื่อ-สกุล"
                        DataField = "full_name"
                        FilterControlWidth = "100%"
                        AutoPostBackOnFilter="true" 
                        CurrentFilterFunction="Contains" 
                        ShowFilterIcon="False">
                        <ItemTemplate><%# Eval("full_name")%>  &nbsp;</ItemTemplate>
                        <HeaderStyle Width = "150px" HorizontalAlign="Center"/>
                        </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn Visible = "false"
                        DataField="new_job_site_name" 
                        HeaderText="สังกัด" 
                        UniqueName="new_job_site_name"                         
                        FilterControlWidth="100%"
                        AutoPostBackOnFilter="true" 
                        CurrentFilterFunction="Contains" 
                        ShowFilterIcon="False">
                        <HeaderStyle Width = "100px" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign = "Left" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn 
                        DataField="new_pos_ref" 
                        HeaderText="เลขที่ตำแหน่ง" 
                        UniqueName="new_pos_ref"                         
                        FilterControlWidth="100%"
                        AutoPostBackOnFilter="true" 
                        CurrentFilterFunction="Contains" 
                        ShowFilterIcon="False">
                        <HeaderStyle Width = "80px" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign = "Center" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn 
                        DataField="new_pos_name" 
                        HeaderText="ตำแหน่ง" 
                        UniqueName="new_pos_name"                         
                        FilterControlWidth="100%"
                        AutoPostBackOnFilter="true" 
                        CurrentFilterFunction="Contains" 
                        ShowFilterIcon="False">
                        <HeaderStyle Width = "100px" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign = "Left" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="class_name" HeaderText="ระดับ" 
                        ShowFilterIcon="false"
                        FilterControlWidth="100%"
                        CurrentFilterFunction="Contains"
                        AutoPostBackOnFilter="true"
                        UniqueName="class_name">
                        <HeaderStyle Wrap="False" HorizontalAlign="Center" />
                        <ItemStyle Width="100px" />
                    </telerik:GridBoundColumn>
                    
                    <telerik:GridBoundColumn 
                        DataField="old_salary" 
                        HeaderText="เงินเดือนเดิม" 
                        UniqueName="old_salary"                         
                        FilterControlWidth="100%"
                        AutoPostBackOnFilter="true" 
                        CurrentFilterFunction="Contains" 
                        ShowFilterIcon="False" 
                        DataFormatString="{0:#,##0.00}">
                        <HeaderStyle Width = "80px" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign = "Right" Wrap="False" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn 
                        DataField="prm_base" 
                        HeaderText="ฐานในการคำนวณ" 
                        UniqueName="prm_base"                         
                        FilterControlWidth="100%"
                        AutoPostBackOnFilter="true" 
                        CurrentFilterFunction="Contains" 
                        DataFormatString="{0:#,##0.00}"
                        ShowFilterIcon="False">
                        <HeaderStyle Width = "80px" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign = "Right" Wrap="False" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn 
                        DataField="prm_percent" 
                        HeaderText="ร้อยละที่ได้เลื่อน" 
                        UniqueName="prm_percent"                         
                        FilterControlWidth="100%"
                        AutoPostBackOnFilter="true" 
                        CurrentFilterFunction="Contains" 
                        ShowFilterIcon="False" 
                        DataFormatString="{0:#,##0.00}">
                        <HeaderStyle Width = "80px" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign = "Center" Wrap="False" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn 
                        DataField="prm_amount" 
                        HeaderText="จำนวนเงินที่ได้เลื่อน" 
                        UniqueName="prm_amount"                         
                        FilterControlWidth="100%"
                        AutoPostBackOnFilter="true" 
                        CurrentFilterFunction="Contains" 
                        ShowFilterIcon="False" 
                        DataFormatString="{0:#,##0.00}">
                        <HeaderStyle Width = "80px" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign = "Right" Wrap="False" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn 
                        DataField="new_salary" 
                        HeaderText="เงินเดือนที่ได้รับ" 
                        UniqueName="new_salary"                         
                        FilterControlWidth="100%"
                        AutoPostBackOnFilter="true" 
                        CurrentFilterFunction="Contains" 
                        ShowFilterIcon="False" 
                        DataFormatString="{0:#,##0.00}">
                        <HeaderStyle Width = "80px" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign = "Right" Wrap="False" />
                    </telerik:GridBoundColumn>
                </Columns>
                <EditFormSettings EditFormType="WebUserControl" 
                    UserControlName="../UserControls/PR_SalaryPromoteCmdDtls.ascx">
                    <EditColumn UniqueName="EditCommandColumn1"></EditColumn>
                </EditFormSettings>
                <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                </MasterTableView>
                <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True" 
                    EnableRowHoverStyle="True" ReorderColumnsOnClient="True">
                    <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
                </ClientSettings>
            </telerik:RadGrid>
        </asp:Panel>
        </td>
        </tr>        
        <tr>
            <td align="center">
            <asp:Button ID="btnPrint" runat="server" Text="พิมพ์" Width="82px" Visible="False" />
            </td>
        </tr>
            
        </table>

        </div></div>
    </form>
</body>
</html>
